#ifndef DATADEFINE_H
#define DATADEFINE_H

#include <stdint.h>

enum class DataCmd : uint16_t
{
    HandShake = (uint16_t)-2,
    Module = (uint16_t)-1,
    Invalid = 0,
    FileUpload,
    AddUploader,
    FileBlock,
    FileData,
    TransferFinish
};

#pragma pack(push,1)
struct protocol
{
    uint16_t nStartFlag;
    uint16_t nPkgLen;
    char szName[11];
    uint16_t nCheckCode;
    uint16_t nEndFlag;
};

struct HandShakeResponse
{
    uint16_t nLen;
    uint16_t nCmd;
    bool bResult;
};

struct DataHead
{
    uint16_t nLen;
    DataCmd nCmd;
};
#pragma pack(pop)

#endif // DATADEFINE_H
